﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace SolParcialMoanso
{
   public class SolParcial:ISolParcial
    {
       private string cadenaCnx = "Data Source=(local);Initial Catalog=DBProyectos;Integrated Security=True";

        public DataTable GetProyectosEmpresaPersonal()
        {
            SqlConnection cnx = new SqlConnection(cadenaCnx);
            //SqlConnection cnx = new SqlConnection();
            //cnx.ConnectionString = cadenaCnx;

            SqlCommand command = 
                new SqlCommand("GetFromContratoProyEmpresa", cnx);
            command.CommandType = CommandType.StoredProcedure;

            SqlDataAdapter adapter = new SqlDataAdapter(command);

            DataTable table = new DataTable();

            cnx.Open();
            adapter.Fill(table);
            cnx.Close();

            return table;
        }
    }
}
